﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class ToggleDisplay : MonoBehaviour
{
    public Toggle toggle;
    public GameObject obj;
    void Start()
    {
        toggle = GetComponentInChildren<Toggle>();
        toggle.onValueChanged.AddListener(OnChanged);
        OnChanged(toggle.isOn);
    }
    void OnChanged(bool value)
    {
        obj.SetActive(value);
    }
}
